#include <cstdio>

const int N = 1e5 + 5;
int n, e_cnt, heads[N], col[N], cnt[3];

struct Edge {
  int v, nxt;
} e[N << 1];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void dfs(int u, int c) {
  col[u] = c, ++cnt[c];
  for (int i = heads[u], v; i; i = e[i].nxt)
    if (!col[v = e[i].v]) dfs(v, c == 1 ? 2 : 1);
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen64("testdata.in", "r", stdin);
  freopen64("testdata.out", "w", stdout);
#else
  freopen("CF862B Mahmoud and Ehab and the bipartiteness.in", "r", stdin);
  freopen("CF862B Mahmoud and Ehab and the bipartiteness.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v), add(v, u);
  }
  dfs(1, 1);
  printf("%lld", 1ll * cnt[1] * cnt[2] - n + 1);
  return 0;
}